package com.jd.openfegin;

import com.jd.domain.Store;
import com.jd.untils.AjaxResutl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreServiceFallbackFactory implements FallbackFactory<StoreService> {
    @Override
    public StoreService create(Throwable throwable) {
        return new StoreService() {
            @Override
            public AjaxResutl add(Store store) {
                return new AjaxResutl(false,"开启熔断，系统繁忙");
            }
        };
    }
}
